package ar.edu.caece.pl.asem.model.impl.treeelements;

import ar.edu.caece.pl.asem.model.impl.SymbolTable;


public class Parametro extends SimboloGenerico {

	public static final int BYREF = 0;
	public static final int BYVAL = 1;
	
	private int mode;	//Solo para Parametros.
	
	public Parametro(String name, int type, int mode) {
		super(name, type);
		this.mode = mode;
		this.label = "PARAMETRO";
	}

	public int getMode() {
		return mode;
	}

	public void setMode(int mode) {
		this.mode = mode;
	}

	@Override
	public String toString() {
		if(this.getMode() == BYREF){
			return this.getLabel()+": "+this.getName() + " (" + SymbolTable.getVerboseType(this.getType())  + ") = BYREF";
		} else {
			return this.getLabel()+": "+this.getName() + " (" + this.getType() + ") = BYVAL";
		}
	}
	
}
